#include "GameMain.h"

static GameDataViewManager *dataview = NULL;
GameDataViewManager *GameDataViewManager::sharedGameDataViewManager()
{
	if(dataview == NULL)
		dataview = new GameDataViewManager();
	return dataview;
}

vector<heroMediator *> GameDataViewManager::getHero()
{
	return hero;
}

void GameDataViewManager::addHero(heroMediator *value)
{
	hero.push_back(value);
}

void GameDataViewManager::removeHero(heroMediator *value)
{
	for(int i = 0; i < hero.size(); i++)
	{
		if(hero.at(i) == value)
		{
			hero.erase(hero.begin() + i);
			return;
		}
	}
}

void GameDataViewManager::removeHeroAll()
{
	hero.clear();
}




vector<buildMediator *> GameDataViewManager::getBuild()
{
	return build;
}

void GameDataViewManager::addBuild(buildMediator *value)
{
	build.push_back(value);
}

void GameDataViewManager::removeBuild(buildMediator *value)
{
	for(int i = 0; i < build.size(); i++)
	{
		if(build.at(i) == value)
		{
			build.erase(build.begin() + i);
			return;
		}
	}
}

void GameDataViewManager::removeBuildAll()
{
	build.clear();
}